<?php

class Form extends CI_Controller {

    public function index()
    {
        $this->load->helper('url');

        $this->load->library('form_validation');

        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('formsuccess');
        }
        else
        {
            $this->load->view('myform');
        }
    }
}